package com.leyou.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.leyou.pojo.Sku;
import com.leyou.pojo.Spu;
import org.apache.ibatis.annotations.Update;

import java.util.Map;

/**
 * @author jshstart
 * @creat 2020-12-11 12:55
 */
public interface SkuMapper extends BaseMapper<Sku> {
    @Update("update tb_sku set stock=stock-#{num},sold=sold+#{num}  where id=#{id}")
    void deductStock(Map<String, Object> map);

}
